<?php
// @filesource video_controller.php

/**
 * Controller_Post 控制器
 */
class Controller_Video extends Controller_Abstract{
	
	function actionIndex(){
        // 为 $this->_view 指定的值将会传递数据到视图中
		$this->_view['text'] = 'Hello, 我是骗人的!';
	}
	
	function actionView(){
		$id = intval($this->_context->object_id);
		$table =QDB::getConn();
		$sql = 'select * from kkyoo_video.tbl_videos where level>0 and object_id='.$id;
		$table->execute('SET NAMES latin1');
		$re = $table->execute($sql);
		if( is_object($re) ){
			$row = $re->fetchRow();
			$re->free();
		}
		$table->execute('SET NAMES utf8');
		if( !empty($row) ){
			$row['title'] = iconv('GB2312', 'UTF-8//IGNORE', $row['title']);
			$this->_view['video'] = $row;
		}else return $this->_redirect( url('video/index') );
	}//END action view
	
}//END Controller Post
?>